﻿// <auto-generated />
using System;
using FitHub.Web.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace FitHub.Web.Migrations
{
    [DbContext(typeof(ApplicationDbContext))]
    partial class ApplicationDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.11")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("FitHub.Data.ApplicationUser", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("integer");

                    b.Property<string>("Bio")
                        .HasColumnType("text")
                        .HasColumnName("bio");

                    b.Property<DateOnly?>("Birthdate")
                        .HasColumnType("date")
                        .HasColumnName("birthdate");

                    b.Property<string>("ConcurrencyStamp")
                        .HasColumnType("text");

                    b.Property<string>("Email")
                        .HasColumnType("text");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("boolean");

                    b.Property<string>("Firstname")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("firstname");

                    b.Property<string>("Lastname")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("lastname");

                    b.Property<string>("Location")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("location");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("boolean");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("NormalizedEmail")
                        .HasColumnType("text");

                    b.Property<string>("NormalizedUserName")
                        .HasColumnType("text");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("text");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("text");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("boolean");

                    b.Property<int?>("Profilepictureid")
                        .HasColumnType("integer")
                        .HasColumnName("profilepictureid");

                    b.Property<DateTime?>("Registrationdate")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("registrationdate");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("text");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("boolean");

                    b.Property<string>("UserName")
                        .HasColumnType("text");

                    b.HasKey("Id")
                        .HasName("users_pkey");

                    b.HasIndex("Profilepictureid");

                    b.HasIndex(new[] { "Email" }, "users_email_key")
                        .IsUnique();

                    b.ToTable("users", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Chat", b =>
                {
                    b.Property<int>("Chatid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("chatid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Chatid"));

                    b.Property<int?>("Chattypeid")
                        .HasColumnType("integer")
                        .HasColumnName("chattypeid");

                    b.Property<string>("Name")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.HasKey("Chatid")
                        .HasName("chats_pkey");

                    b.HasIndex("Chattypeid");

                    b.ToTable("chats", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Chatmessage", b =>
                {
                    b.Property<int>("Messageid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("messageid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Messageid"));

                    b.Property<int>("Chatid")
                        .HasColumnType("integer")
                        .HasColumnName("chatid");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("content");

                    b.Property<DateTime>("Timestamp")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("timestamp");

                    b.Property<string>("Userid")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("userid");

                    b.HasKey("Messageid")
                        .HasName("chatmessages_pkey");

                    b.HasIndex("Chatid");

                    b.HasIndex("Userid");

                    b.ToTable("chatmessages", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Chatparticipant", b =>
                {
                    b.Property<int>("Participantid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("participantid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Participantid"));

                    b.Property<int>("Chatid")
                        .HasColumnType("integer")
                        .HasColumnName("chatid");

                    b.Property<bool>("Ismoderator")
                        .HasColumnType("boolean")
                        .HasColumnName("ismoderator");

                    b.Property<string>("Userid")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("userid");

                    b.HasKey("Participantid")
                        .HasName("chatparticipants_pkey");

                    b.HasIndex("Chatid");

                    b.HasIndex("Userid");

                    b.ToTable("chatparticipants", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Chattype", b =>
                {
                    b.Property<int>("Chattypeid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("chattypeid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Chattypeid"));

                    b.Property<string>("Name")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.HasKey("Chattypeid")
                        .HasName("chattypes_pkey");

                    b.ToTable("chattypes", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Comment", b =>
                {
                    b.Property<int>("Commentid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("commentid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Commentid"));

                    b.Property<string>("Content")
                        .HasColumnType("text")
                        .HasColumnName("content");

                    b.Property<DateTime?>("Creationdate")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("creationdate");

                    b.Property<int>("Postid")
                        .HasColumnType("integer")
                        .HasColumnName("postid");

                    b.Property<int?>("Statusid")
                        .HasColumnType("integer")
                        .HasColumnName("statusid");

                    b.Property<string>("Userid")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("userid");

                    b.HasKey("Commentid")
                        .HasName("comments_pkey");

                    b.HasIndex("Postid");

                    b.HasIndex("Statusid");

                    b.HasIndex("Userid");

                    b.ToTable("comments", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Diary", b =>
                {
                    b.Property<int>("Diaryid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("diaryid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Diaryid"));

                    b.Property<DateTime?>("Creationdate")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("creationdate");

                    b.Property<string>("Creatorid")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("creatorid");

                    b.Property<DateTime?>("Lastmodifieddate")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("lastmodifieddate");

                    b.HasKey("Diaryid")
                        .HasName("diaries_pkey");

                    b.HasIndex("Creatorid");

                    b.ToTable("diaries", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Diaryexercise", b =>
                {
                    b.Property<int>("Diaryexerciseid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("diaryexerciseid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Diaryexerciseid"));

                    b.Property<int?>("Diaryid")
                        .HasColumnType("integer")
                        .HasColumnName("diaryid");

                    b.Property<int?>("Exerciseinfoid")
                        .HasColumnType("integer")
                        .HasColumnName("exerciseinfoid");

                    b.HasKey("Diaryexerciseid")
                        .HasName("diaryexercise_pkey");

                    b.HasIndex("Diaryid");

                    b.HasIndex("Exerciseinfoid");

                    b.ToTable("diaryexercise", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Exercise", b =>
                {
                    b.Property<int>("Exerciseid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("exerciseid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Exerciseid"));

                    b.Property<string>("Name")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.HasKey("Exerciseid")
                        .HasName("exercises_pkey");

                    b.ToTable("exercises", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Exerciseinfo", b =>
                {
                    b.Property<int>("Exerciseinfoid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("exerciseinfoid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Exerciseinfoid"));

                    b.Property<int?>("Exerciseid")
                        .HasColumnType("integer")
                        .HasColumnName("exerciseid");

                    b.Property<TimeSpan?>("Leadtime")
                        .HasColumnType("interval")
                        .HasColumnName("leadtime");

                    b.Property<int?>("Reps")
                        .HasColumnType("integer")
                        .HasColumnName("reps");

                    b.Property<int?>("Sets")
                        .HasColumnType("integer")
                        .HasColumnName("sets");

                    b.Property<double?>("Weightload")
                        .HasColumnType("double precision")
                        .HasColumnName("weightload");

                    b.HasKey("Exerciseinfoid")
                        .HasName("exerciseinfo_pkey");

                    b.HasIndex("Exerciseid");

                    b.ToTable("exerciseinfo", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Image", b =>
                {
                    b.Property<int>("Imageid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("imageid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Imageid"));

                    b.Property<DateTime?>("Creationdate")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("creationdate");

                    b.Property<byte[]>("Imagedata")
                        .HasColumnType("bytea")
                        .HasColumnName("imagedata");

                    b.Property<string>("Imagetype")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("imagetype");

                    b.Property<int?>("Postid")
                        .HasColumnType("integer")
                        .HasColumnName("postid");

                    b.Property<string>("Userid")
                        .HasColumnType("text")
                        .HasColumnName("userid");

                    b.HasKey("Imageid")
                        .HasName("images_pkey");

                    b.HasIndex("Postid");

                    b.HasIndex("Userid");

                    b.ToTable("images", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Post", b =>
                {
                    b.Property<int>("Postid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("postid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Postid"));

                    b.Property<string>("Content")
                        .HasColumnType("text")
                        .HasColumnName("content");

                    b.Property<DateTime?>("Creationdate")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("creationdate");

                    b.Property<int?>("Statusid")
                        .HasColumnType("integer")
                        .HasColumnName("statusid");

                    b.Property<string>("Title")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("title");

                    b.Property<int?>("Titleimageid")
                        .HasColumnType("integer")
                        .HasColumnName("titleimageid");

                    b.Property<string>("Userid")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("userid");

                    b.HasKey("Postid")
                        .HasName("posts_pkey");

                    b.HasIndex("Statusid");

                    b.HasIndex("Titleimageid");

                    b.HasIndex("Userid");

                    b.ToTable("posts", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Postimage", b =>
                {
                    b.Property<int>("Postimageid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("postimageid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Postimageid"));

                    b.Property<int?>("Imageid")
                        .HasColumnType("integer")
                        .HasColumnName("imageid");

                    b.Property<string>("Imagelocation")
                        .HasColumnType("text")
                        .HasColumnName("imagelocation");

                    b.Property<int?>("Postid")
                        .HasColumnType("integer")
                        .HasColumnName("postid");

                    b.HasKey("Postimageid")
                        .HasName("postimages_pkey");

                    b.HasIndex("Imageid");

                    b.HasIndex("Postid");

                    b.ToTable("postimages", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Postssport", b =>
                {
                    b.Property<int>("Postsportid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("postsportid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Postsportid"));

                    b.Property<int?>("Postid")
                        .HasColumnType("integer")
                        .HasColumnName("postid");

                    b.Property<int?>("Sporttypeid")
                        .HasColumnType("integer")
                        .HasColumnName("sporttypeid");

                    b.HasKey("Postsportid")
                        .HasName("postssports_pkey");

                    b.HasIndex("Postid");

                    b.HasIndex("Sporttypeid");

                    b.ToTable("postssports", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Sporttype", b =>
                {
                    b.Property<int>("Sporttypeid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("sporttypeid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Sporttypeid"));

                    b.Property<string>("Name")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.HasKey("Sporttypeid")
                        .HasName("sporttype_pkey");

                    b.ToTable("sporttype", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Status", b =>
                {
                    b.Property<int>("Statusid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("statusid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Statusid"));

                    b.Property<string>("Name")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.HasKey("Statusid")
                        .HasName("status_pkey");

                    b.ToTable("status", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Usersport", b =>
                {
                    b.Property<int>("Usersportid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("usersportid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Usersportid"));

                    b.Property<int>("Sporttypeid")
                        .HasColumnType("integer")
                        .HasColumnName("sporttypeid");

                    b.Property<string>("Userid")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("userid");

                    b.HasKey("Usersportid")
                        .HasName("usersports_pkey");

                    b.HasIndex("Sporttypeid");

                    b.HasIndex("Userid");

                    b.ToTable("usersports", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Workoutplan", b =>
                {
                    b.Property<int>("Planid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("planid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Planid"));

                    b.Property<DateTime?>("Creationdate")
                        .HasColumnType("timestamp without time zone")
                        .HasColumnName("creationdate");

                    b.Property<string>("Creatorid")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("creatorid");

                    b.Property<string>("Description")
                        .HasColumnType("text")
                        .HasColumnName("description");

                    b.Property<string>("Name")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.Property<bool?>("Privacy")
                        .HasColumnType("boolean")
                        .HasColumnName("privacy");

                    b.HasKey("Planid")
                        .HasName("workoutplans_pkey");

                    b.HasIndex("Creatorid");

                    b.ToTable("workoutplans", (string)null);
                });

            modelBuilder.Entity("FitHub.Data.Workoutplanexercise", b =>
                {
                    b.Property<int>("Workoutplanexerciseid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("workoutplanexerciseid");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Workoutplanexerciseid"));

                    b.Property<int?>("Exerciseinfoid")
                        .HasColumnType("integer")
                        .HasColumnName("exerciseinfoid");

                    b.Property<int?>("Planid")
                        .HasColumnType("integer")
                        .HasColumnName("planid");

                    b.HasKey("Workoutplanexerciseid")
                        .HasName("workoutplanexercise_pkey");

                    b.HasIndex("Exerciseinfoid");

                    b.HasIndex("Planid");

                    b.ToTable("workoutplanexercise", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("text");

                    b.Property<string>("ConcurrencyStamp")
                        .HasColumnType("text");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.Property<string>("NormalizedName")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Roles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("text");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("text");

                    b.Property<string>("RoleId")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("RoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("text");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("text");

                    b.Property<string>("UserId")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("UserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("text");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("text");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("text");

                    b.Property<string>("UserId")
                        .HasColumnType("text");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.ToTable("UserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("text");

                    b.Property<string>("RoleId")
                        .HasColumnType("text");

                    b.HasKey("UserId", "RoleId");

                    b.ToTable("UserRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("text");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("text");

                    b.Property<string>("Name")
                        .HasColumnType("text");

                    b.Property<string>("Value")
                        .HasColumnType("text");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("UserTokens");
                });

            modelBuilder.Entity("FitHub.Data.ApplicationUser", b =>
                {
                    b.HasOne("FitHub.Data.Image", "Profilepicture")
                        .WithMany("Users")
                        .HasForeignKey("Profilepictureid")
                        .HasConstraintName("fk_users_profile_picture");

                    b.Navigation("Profilepicture");
                });

            modelBuilder.Entity("FitHub.Data.Chat", b =>
                {
                    b.HasOne("FitHub.Data.Chattype", "Chattype")
                        .WithMany("Chats")
                        .HasForeignKey("Chattypeid")
                        .HasConstraintName("chats_chattypeid_fkey");

                    b.Navigation("Chattype");
                });

            modelBuilder.Entity("FitHub.Data.Chatmessage", b =>
                {
                    b.HasOne("FitHub.Data.Chat", "Chat")
                        .WithMany("Chatmessages")
                        .HasForeignKey("Chatid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("chatmessages_chatid_fkey");

                    b.HasOne("FitHub.Data.ApplicationUser", "User")
                        .WithMany("Chatmessages")
                        .HasForeignKey("Userid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("chatmessages_userid_fkey");

                    b.Navigation("Chat");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FitHub.Data.Chatparticipant", b =>
                {
                    b.HasOne("FitHub.Data.Chat", "Chat")
                        .WithMany("Chatparticipants")
                        .HasForeignKey("Chatid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("chatparticipants_chatid_fkey");

                    b.HasOne("FitHub.Data.ApplicationUser", "User")
                        .WithMany("Chatparticipants")
                        .HasForeignKey("Userid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("chatparticipants_userid_fkey");

                    b.Navigation("Chat");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FitHub.Data.Comment", b =>
                {
                    b.HasOne("FitHub.Data.Post", "Post")
                        .WithMany("Comments")
                        .HasForeignKey("Postid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("comments_postid_fkey");

                    b.HasOne("FitHub.Data.Status", "Status")
                        .WithMany("Comments")
                        .HasForeignKey("Statusid")
                        .HasConstraintName("comments_statusid_fkey");

                    b.HasOne("FitHub.Data.ApplicationUser", "User")
                        .WithMany("Comments")
                        .HasForeignKey("Userid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("comments_userid_fkey");

                    b.Navigation("Post");

                    b.Navigation("Status");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FitHub.Data.Diary", b =>
                {
                    b.HasOne("FitHub.Data.ApplicationUser", "Creator")
                        .WithMany("Diaries")
                        .HasForeignKey("Creatorid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("diaries_creatorid_fkey");

                    b.Navigation("Creator");
                });

            modelBuilder.Entity("FitHub.Data.Diaryexercise", b =>
                {
                    b.HasOne("FitHub.Data.Diary", "Diary")
                        .WithMany("Diaryexercises")
                        .HasForeignKey("Diaryid")
                        .HasConstraintName("diaryexercise_diaryid_fkey");

                    b.HasOne("FitHub.Data.Exerciseinfo", "Exerciseinfo")
                        .WithMany("Diaryexercises")
                        .HasForeignKey("Exerciseinfoid")
                        .HasConstraintName("diaryexercise_exerciseinfoid_fkey");

                    b.Navigation("Diary");

                    b.Navigation("Exerciseinfo");
                });

            modelBuilder.Entity("FitHub.Data.Exerciseinfo", b =>
                {
                    b.HasOne("FitHub.Data.Exercise", "Exercise")
                        .WithMany("Exerciseinfos")
                        .HasForeignKey("Exerciseid")
                        .HasConstraintName("exerciseinfo_exerciseid_fkey");

                    b.Navigation("Exercise");
                });

            modelBuilder.Entity("FitHub.Data.Image", b =>
                {
                    b.HasOne("FitHub.Data.Post", "Post")
                        .WithMany("Images")
                        .HasForeignKey("Postid")
                        .HasConstraintName("fk_images_post");

                    b.HasOne("FitHub.Data.ApplicationUser", "User")
                        .WithMany("Images")
                        .HasForeignKey("Userid")
                        .HasConstraintName("fk_images_user");

                    b.Navigation("Post");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FitHub.Data.Post", b =>
                {
                    b.HasOne("FitHub.Data.Status", "Status")
                        .WithMany("Posts")
                        .HasForeignKey("Statusid")
                        .HasConstraintName("posts_statusid_fkey");

                    b.HasOne("FitHub.Data.Image", "Titleimage")
                        .WithMany("Posts")
                        .HasForeignKey("Titleimageid")
                        .HasConstraintName("posts_titleimageid_fkey");

                    b.HasOne("FitHub.Data.ApplicationUser", "User")
                        .WithMany("Posts")
                        .HasForeignKey("Userid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("posts_userid_fkey");

                    b.Navigation("Status");

                    b.Navigation("Titleimage");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FitHub.Data.Postimage", b =>
                {
                    b.HasOne("FitHub.Data.Image", "Image")
                        .WithMany("Postimages")
                        .HasForeignKey("Imageid")
                        .HasConstraintName("postimages_imageid_fkey");

                    b.HasOne("FitHub.Data.Post", "Post")
                        .WithMany("Postimages")
                        .HasForeignKey("Postid")
                        .HasConstraintName("postimages_postid_fkey");

                    b.Navigation("Image");

                    b.Navigation("Post");
                });

            modelBuilder.Entity("FitHub.Data.Postssport", b =>
                {
                    b.HasOne("FitHub.Data.Post", "Post")
                        .WithMany("Postssports")
                        .HasForeignKey("Postid")
                        .HasConstraintName("postssports_postid_fkey");

                    b.HasOne("FitHub.Data.Sporttype", "Sporttype")
                        .WithMany("Postssports")
                        .HasForeignKey("Sporttypeid")
                        .HasConstraintName("postssports_sporttypeid_fkey");

                    b.Navigation("Post");

                    b.Navigation("Sporttype");
                });

            modelBuilder.Entity("FitHub.Data.Usersport", b =>
                {
                    b.HasOne("FitHub.Data.Sporttype", "Sporttype")
                        .WithMany("Usersports")
                        .HasForeignKey("Sporttypeid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("usersports_sporttypeid_fkey");

                    b.HasOne("FitHub.Data.ApplicationUser", "User")
                        .WithMany("Usersports")
                        .HasForeignKey("Userid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("usersports_userid_fkey");

                    b.Navigation("Sporttype");

                    b.Navigation("User");
                });

            modelBuilder.Entity("FitHub.Data.Workoutplan", b =>
                {
                    b.HasOne("FitHub.Data.ApplicationUser", "Creator")
                        .WithMany("Workoutplans")
                        .HasForeignKey("Creatorid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired()
                        .HasConstraintName("workoutplans_creatorid_fkey");

                    b.Navigation("Creator");
                });

            modelBuilder.Entity("FitHub.Data.Workoutplanexercise", b =>
                {
                    b.HasOne("FitHub.Data.Exerciseinfo", "Exerciseinfo")
                        .WithMany("Workoutplanexercises")
                        .HasForeignKey("Exerciseinfoid")
                        .HasConstraintName("workoutplanexercise_exerciseinfoid_fkey");

                    b.HasOne("FitHub.Data.Workoutplan", "Plan")
                        .WithMany("Workoutplanexercises")
                        .HasForeignKey("Planid")
                        .HasConstraintName("workoutplanexercise_planid_fkey");

                    b.Navigation("Exerciseinfo");

                    b.Navigation("Plan");
                });

            modelBuilder.Entity("FitHub.Data.ApplicationUser", b =>
                {
                    b.Navigation("Chatmessages");

                    b.Navigation("Chatparticipants");

                    b.Navigation("Comments");

                    b.Navigation("Diaries");

                    b.Navigation("Images");

                    b.Navigation("Posts");

                    b.Navigation("Usersports");

                    b.Navigation("Workoutplans");
                });

            modelBuilder.Entity("FitHub.Data.Chat", b =>
                {
                    b.Navigation("Chatmessages");

                    b.Navigation("Chatparticipants");
                });

            modelBuilder.Entity("FitHub.Data.Chattype", b =>
                {
                    b.Navigation("Chats");
                });

            modelBuilder.Entity("FitHub.Data.Diary", b =>
                {
                    b.Navigation("Diaryexercises");
                });

            modelBuilder.Entity("FitHub.Data.Exercise", b =>
                {
                    b.Navigation("Exerciseinfos");
                });

            modelBuilder.Entity("FitHub.Data.Exerciseinfo", b =>
                {
                    b.Navigation("Diaryexercises");

                    b.Navigation("Workoutplanexercises");
                });

            modelBuilder.Entity("FitHub.Data.Image", b =>
                {
                    b.Navigation("Postimages");

                    b.Navigation("Posts");

                    b.Navigation("Users");
                });

            modelBuilder.Entity("FitHub.Data.Post", b =>
                {
                    b.Navigation("Comments");

                    b.Navigation("Images");

                    b.Navigation("Postimages");

                    b.Navigation("Postssports");
                });

            modelBuilder.Entity("FitHub.Data.Sporttype", b =>
                {
                    b.Navigation("Postssports");

                    b.Navigation("Usersports");
                });

            modelBuilder.Entity("FitHub.Data.Status", b =>
                {
                    b.Navigation("Comments");

                    b.Navigation("Posts");
                });

            modelBuilder.Entity("FitHub.Data.Workoutplan", b =>
                {
                    b.Navigation("Workoutplanexercises");
                });
#pragma warning restore 612, 618
        }
    }
}
